<?php if($_GET['type']=='list'){?>
<div class="wrapMain">
  <div id="row">
		    <div class="col-md-8"> 
                       <ul class="breadcrumb-arrow">
                        <li><a href="<?php echo HOME; ?>"><i class="fa fa-home"></i> Home</a></li>
                         <li><a href="<?php echo HOME."member"; ?>">Member</a></li>
						 </ul>
  	 <div class="panel panel-default">
 	  		<div class="panel-body" style="padding:0px; margin:0px"> 
      				 <div class="item_blog_detail">
						  <div class="head_info" style="border-bottom:1px solid #eee; padding:0px; margin:0px; background-color:#fafafa">
                                  <form class="navbar-form" role="search" action="<?php echo url(); ?>" method="post">
        <div class="input-group">
          <input type="text" class="form-control" placeholder="Nhập Tên User cần tìm kiếm ..." name="srch-term" id="srch-term" style="height:34px">
          <div class="input-group-btn">
            <button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-search"></span></button>
          </div>
        </div>
      </form>
  </div> <!-- End of headinf0 -->
<div style="height:20px"></div>
  <?php echo $data['nav']; ?>
 <div class="table-responsive">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>#</th>
                <th>Avatar</th>
                <th>Username</th>
                <th>Ngày Đăng Ký</th>
                <th>Group</th>
               
            </tr>
        </thead>
        <tbody>
          <?php
		  $j=0;
		  if($data['info']){
			  foreach($data['info'] as $row){
				 echo "<tr>";
				 echo "<td>".++$j."</td>";
				 echo "<td>".get_avatar($row['avatar'],$row['facebook_id'])."</td>";
				 echo "<td><a href='".url_user($row['username'])."'>".$row['username']."</a></td>";
				 echo "<td>".$row['date_registered']."</td>";
				 echo "<td>".get_group($row['group_id'])."</td>";
				 echo "</tr>";  
			  
			  }
		  }else{
		  ?>
          <tr><td colspan="5"><div class="alert alert-warning">Không Tìm Thấy Kết Qủa Nào</div></td></tr>
          <?php
		  }
		   ?>
          
         
        </tbody>
    </table>
</div>  
  <?php echo $data['nav']; ?>       
					
                   </div> <!-- End of item_blog_detail -->
                    </div> <!-- End of panel body -->
					</div><!-- end of panel   -->
                    </div>
    
                    
                    </div> <!-- End of col-md-8 -->
                    
                    <!-- Start Right Block -->
                    <div class="col-md-4">
                    <?php  render_fanpage(); ?>
					<?php render_donate(); ?>
</div> <!-- End of md-colum-4 -->                    
  </div><!-- End of row -->
                    </div> <!-- End of wrapmain -->
					<div class="clearfix"></div>	
                    
<?php }?>
<?php if($_GET['type']=='user'){?>                    	
									<div class="wrapMain">

    
    <div id="row">
		    <div class="col-md-8"> 
               	
                    <ul class="breadcrumb-arrow">
                      
                       <li><a href="<?php echo HOME; ?>"><i class="fa fa-home"></i> Home</a></li>
                         <li><a href="<?php echo HOME."member"; ?>">Member</a></li>
                        <li><a href="<?php echo url(); ?>"><?php echo $_GET['user'] ?></a></li>
                       
                        </ul>
   				
                    
                    
                    
             <div class="panel panel-default">
 	  		<div class="panel-body" style="padding:0px; margin:0px"> 
      				 <div class="item_blog_detail">
						  <div class="head_info" style="border-bottom:1px solid #eee; padding:0px; margin:0px; background-color:#fafafa">
                                  <h1><i class="fa fa-home"></i> Thảo Luận - Nhắn Tin trên tường của <span style="color:#F00"> <?php echo $data['user']['show']; ?></span></h1>
                         
        
                                
                          </div> <!-- End of headinf0 -->
									 <p class="detail_description" style="margin-left:10px">
									Nếu bạn có vấn đề nào muốn trao đổi hoặc muốn nhắn tin cho <b><?php echo $data['user']['show']; ?></b> thì bạn có thể comment ở đây hoặc liên hệ trực tiếp bằng những thông tin liên hệ của  <b><?php echo $data['user']['show']; ?></b>.
									</p>
                                  <style>.fb_iframe_widget,
.fb_iframe_widget span,
.fb_iframe_widget iframe[style]  {width: 100% !important;}</style>
                    	<div id="fb-comment-box" class="facebook-comment"><div class="fb-comments" data-href="<?php echo url(); ?>"></div>

                             
						
	
                	<div style="height:20px"></div>
                  
                                   
					
                   </div> <!-- End of item_blog_detail -->
                    </div> <!-- End of panel body -->
					</div><!-- end of panel   -->
                    </div>
                  
                   
                    <!-- Start box comment -->
  
                         <script>
			window.fbAsyncInit = function() {
 FB.init({appId: '<?php echo FB_ID;?>', status: true, cookie: true, xfbml: true});

     FB.Event.subscribe('comment.create', function(response) {
          var commentQuery = FB.Data.query('SELECT fromid, text FROM comment WHERE post_fbid=\'' + response.commentID + '\' AND object_id IN (SELECT comments_fbid FROM link_stat WHERE url=\'' + response.href + '\')');
      var user = FB.Data.query(
       "select name, id, url, pic_square from profile where id in"
     + "(select fromid from {0})", commentQuery);
 
  FB.Data.waitOn([commentQuery,user], function () {
   ct = commentQuery.value[0].text;

   u = user.value[0].name;
   td='<?php echo $_GET['user'] ?>';
   url='<?php echo url() ?>';
   m='channel';
   ip='<?php echo get_ip(); ?>';
   id='<?php echo $data['user']['id'] ?>';
	// Query get user info with fromid
	//Send data to server using ajax ------ KAKAKAKAKAKA
			 var   values='comment_user='+u+'&comment_tieude='+td+'&comment_url='+url+'&comment_type='+m+'&ip='+ip+'&comment_id='+id+
    '&comment_content='+ct+'&module=user&act=ajax&add_comment';
	
  	$.ajax({
      url: "index.php",
      type: "post",
      data: values,
      success: function(data){
          },
   
    }); 
	
    // Use your preferred way to inform the server to save comment
     });
 });         
 };
 
 </script>        
                
                    
                    </div> <!-- End of col-md-8 -->
                    
                    <!-- Start Right Block -->
                    <div class="col-md-4">
                      <?php 
					render_user_box($data);
					 ?>
                    <Br/>
                    <Br/>
                    <?php 
				
					render_donate(); ?>
           
                  </div> <!-- End of md-colum-4 -->                    
                   
                    
                    
                    </div><!-- End of row -->
                    </div> <!-- End of wrapmain -->
					<div class="clearfix"></div>		
				<?php } //end get type==user ?>